def print_file_info(file_name):
    f=None
    try:
        with open("file_name","r") as f:
            f.read()
    except:
        print("文件不存在")
    finally:
        if f:
            f.close()
def append_to_file(file_name,data):
    with open("file_name","a") as fr:
        fr.write(data)
if __name__ == '__main__':
    print_file_info("dadaa.txt")